package com.itheima.stock.mapper;

import com.itheima.stock.pojo.SysUser;
import com.itheima.stock.vo.req.UsersPageReqVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 郭鑫超
* @description 针对表【sys_user(用户表)】的数据库操作Mapper
* @createDate 2023-02-23 14:40:41
* @Entity com.itheima.stock.pojo.SysUser
*/
@Mapper
public interface SysUserMapper {

    /**
     * 查询所有
     * @return List<User>
     */
    List<SysUser> selectAll();



    SysUser selectOneToUserName(String username);

    @Select("select * from sys_user WHERE deleted = 1 LIMIT #{pageNum},#{pageSize}")
    List<SysUser> usersPage(@Param("pageNum") Integer pageNum,@Param("pageSize")Integer pageSize);

    @Select("select real_name from sys_user where id = #{createId}")
    String selectCreateNameById(String createId);
    @Select("select real_name from sys_user where id = #{updateId}")
    String selectUpdateNameById(String updateId);

    List<SysUser> selectToUser(UsersPageReqVo vo);
}




